#pragma once

class InputBox : public UIElement, public Singleton<InputBox>
{
	Vertex3FRHWT m_baseVertices1[4];
	Vertex3FRHWT m_baseVertices2[4];
	Texture* m_baseTexture1;
	Texture* m_baseTexture2;
	Vertex3FRHWC m_linePoints[5];
	ui32 m_lastChange;
	bool m_drawCursel;
	bool m_focus;
	std::string m_szText;
	std::string m_szRenderText;
	CFont m_text;
	ui32 m_curLength;
	i32 m_historyPoint;
	std::deque<std::string> m_history;
public:
	InputBox(ui32 x, ui32 y, ui32 w, ui32 h);
	void Draw();
	void OnEnterPressed();
	void MouseActivity(bool left, Vertex2F pos, bool up);
	bool HasFocus() { return m_focus; }
	void OnKey(char key);
	void OnVirtualKey(char vKeyCode);
};

#define sInput (*InputBox::GetInstance())